package com.admin.common.enums;

/**
 * 用户身份
 *         用户级别， province 省， city 市  area 区县
 */
public enum MemberLevelEnum {
    USER("user", "申报用户标识"),
    PROVINCE ("province", "省用户"),
    CITY("city", "市用户"),
    AREA("area", "区县用户")
    ;

    private String key;
    private String name;

    MemberLevelEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public String getKey() {
        return key;
    }


    public String getName() {
        return name;
    }

    public static String getText(String key) {
        if (key == null) {
            return null;
        }
        for (MemberLevelEnum e : MemberLevelEnum.values()) {
            if (e.getKey().equals(key)) {
                return e.getName();
            }
        }
        return null;
    }

}
